import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
const Home = () => import('../views/Home')
// import News from "../views/News";
const News = () => import('../views/News')
// import Project from "../views/Project";
// import Member from "../views/Member";
// import About from "../views/About";
const Project = () => import('../views/Project')
const Member = () => import('../views/Member')
const About = () => import('../views/About')
const Mien = () => import('../views/Mien')


// import Synopsis from "../components/about/Synopsis";
// import LearningDirection from "../components/about/LearningDirection";
// import History from "../components/about/History";
// import System from "../components/about/System";
// import Teacher from "../components/about/Teacher";
const Synopsis = () => import('../components/about/Synopsis')
const LearningDirection = () => import('../components/about/LearningDirection')
const History = () => import('../components/about/History')
const System = () => import('../components/about/System')
const Teacher = () => import('../components/about/Teacher')


// import Mien from "../views/Mien";
// import CopyRights from "../components/mien/CopyRights";
// import Competition from "../components/mien/Competition";
// import ProjectAward from "../components/mien/ProjectAward";
const CopyRights = () => import('../components/mien/CopyRights')
const Competition = () => import('../components/mien/Competition')
const ProjectAward = () => import('../components/mien/ProjectAward')

// import Journalism from "../components/news/Journalism";
const Journalism = () => import('../components/news/Journalism')

// import Blog from "../components/member/Blog";
// import Leader from "../components/member/Leader";
// import Previous from "../components/member/Previous";
// import Details from "../components/member/Details";
const Blog = () => import('../components/member/Blog')
const Leader = () => import('../components/member/Leader')
const Details = () => import('../components/member/Details')
const Previous = () => import('../components/member/Previous')



//拓展路由
import adminRouter from "./admin";
// const adminRouter = () => import('./admin')

Vue.use(VueRouter)

const routes = [
    {
        path: '',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/news',
        name: 'news',
        component: News,
    },
    {
        path: '/news/journalism/:nid',
        name: 'journalism',
        component: Journalism
    },
    {
        path: '/project',
        name: 'project',
        component: Project
    },
    {
        path: '/member',
        name: 'member',
        component: Member,
        children: [
            {
                path: '',
                redirect: 'leader'
            },
            {
                path: 'blog/:grade',
                component: Blog
            },
            {
                path: 'leader',
                component: Leader
            },
            {
                path: 'previous',
                component: Previous
            }
        ]
    },
    {
        path: '/member/leader/details/:mid',
        name: 'details',
        component: Details
    },
    {
        path: '/mien',
        name: 'mien',
        component: Mien,
        children: [
            {
                path: '',
                redirect: 'copyRights'
            },
            {
                path: 'copyRights',
                component: CopyRights
            },
            {
                path: 'competition',
                component: Competition
            },
            {
                path: 'projectAward',
                component: ProjectAward
            }
        ]
    },
    {
        path: '/about',
        name: 'about',
        component: About,
        children: [
            {
                path: '',
                redirect: 'synopsis'
            },
            {
                path: 'synopsis',
                component: Synopsis
            },
            {
                path: 'learningdirection',
                component: LearningDirection
            },
            {
                path: 'history',
                component: History
            },
            {
                path: 'system',
                component: System
            },
            {
                path: 'teacher',
                component: Teacher
            }
        ]
    },
    // {
    //   path:'*',
    //   component: Home
    // },
    ...adminRouter

]
const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
